<template>
  <button @click="btn">测试</button>
</template>
<script>

import { getToken } from '@/utils/auth'
import { getTest } from '@/api/test'
export default ({
  data() {
    return {
      // 设置上传的请求头部
      headers: { Authorization: 'Bearer ' + getToken() }
    }
  },
  methods: {
    btn() {
      getTest().then(response => {
        console.log(getToken())
        console.log(response)
        alert(213)
      }
      )
    }
  }
})
</script>
<style>

</style>
